<?php
namespace app\api\validate;

use think\Validate;

class Stage extends Validate
{
    protected $rule =   [
        'stage' => 'require|max:5|chs|min:3',
        'course_id' => 'require|number|notin:0',
    ];
    
    protected $message  =   [
        'stage.require' => '课程内容不能为空',
        'course_id.require' => '缺失必要参数',
        'course_id.number' => '课程id参数错误',
        'course_id.notin' => '课程id参数错误',
        'stage.max' => '内容格式错误(建议内容格式:阶段一)',
        'stage.chs' => '内容格式错误(建议内容格式:阶段一)',
        'stage.min' => '内容格式错误(建议内容格式:阶段一)',
    ];

    protected $scene = [
        // 添加阶段
        'createStage' => ['stage','course_id'],
    ];
    
}